Skip to content

Port consent updates from springfield#17299

Open
stephaniehobson wants to merge 1 commit into
mainfrom
consent
Open

Port consent updates from springfield#17299
stephaniehobson wants to merge 1 commit into
mainfrom
consent

Conversation

@stephaniehobson

@stephaniehobson stephaniehobson commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

One-line summary

Ports the basic consent mode configuration from springfield but does not port the download attribution or promoted pages concept.

Significant changes and points to review

Issue / Bugzilla link

Original JIRA ticket: https://mozilla-hub.atlassian.net/browse/WT-602
Completed in: mozmeao/springfield#955

Testing

Available on Demo 3:

When GTM is loaded:

  • and there is no existing analytics cookie, defaults are denied
  • and there is an existing analytics cookie TRUE, defaults are granted

When user indicates pref, an 'update' dataLayer event appears:

Screenshot 2026-02-11 at 6 50 19 PM

Google verification docs: https://developers.google.com/tag-platform/security/guides/consent-debugging#start-debugging

Ports the basic consent mode configuration from springfield but
does not port the download attribution or promoted pages concept.

Original JIRA ticket: https://mozilla-hub.atlassian.net/browse/WT-602
Completed in: mozmeao/springfield#955

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports the baseline Google Consent Mode behavior from springfield into Bedrock’s existing consent + GTM integration, ensuring gtag consent defaults are set before GTM loads and consent updates are applied when user preferences change.

Changes:

  • Added setGtagAdsConsentMode / setGtagAnalyticsConsentMode helpers to centralize gtag consent-mode updates.
  • Updated the GTM snippet to set consent defaults prior to loading GTM and to apply consent updates on mozConsentStatus.
  • Expanded Jasmine unit coverage for the new consent-mode behavior in both consent utils and GTM snippet specs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/unit/spec/base/gtm/gtm-snippet.js Adds unit tests for gtag consent defaults and consent update handling.
tests/unit/spec/base/consent/consent-utils.js Adds unit tests for new gtag consent-mode helper utilities.
media/js/base/gtm/gtm-snippet.es6.js Initializes dataLayer, sets consent defaults before loading GTM, and updates consent on consent events.
media/js/base/consent/utils.es6.js Introduces gtag consent-mode helper functions and calls them after setting the consent cookie.

Comment thread media/js/base/gtm/gtm-snippet.es6.js
Comment thread media/js/base/consent/utils.es6.js
Comment thread media/js/base/consent/utils.es6.js
@stephaniehobson
stephaniehobson marked this pull request as ready for review July 22, 2026 21:02
@stephaniehobson
stephaniehobson requested a review from a team as a code owner July 22, 2026 21:02
@stephaniehobson stephaniehobson added the Needs Review Awaiting code review label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants